import QtQuick
import QtQuick.Window

Window {
    width: 300
    height: 480
    visible: true
    title: qsTr("Rect")

    // 矩形
    Rectangle {
        id: rect1
        x: 12; y: 12
        width: 76; height: 96
        color: 'lightsteelblue'
//        color: Qt.rgba(Math.random(), Math.random(), Math.random(), 1)
    }

    // 圆角矩形
    Rectangle {
        id: rect2
        x: 112; y: 12
        width: 76; height: 96
        border.color: 'lightsteelblue'
        border.width: 4
        radius: 20
    }

    // 渐变色
    Rectangle {
        id: rect3
        x: 212; y: 12
        width: 76; height: 96
        gradient: Gradient {
            // position标记y轴上的位置(0=顶部, 1=底部)
            GradientStop {position: 0.0; color: 'green'}
            GradientStop {position: 1.0; color: 'red'}
        }

        border.color: 'lightsteelblue'
        border.width: 4
        radius: 20
    }
}
